home *** CD-ROM | disk | FTP | other *** search
- property pSprite, spriteNum, pLocation, pRotation, pInc, pWow
-
- on beginSprite me
- pSprite = sprite(spriteNum)
- pLocation = [float(pSprite.locH), float(pSprite.locV)]
- pRotation = 0
- pInc = 25
- pWow = 1.57000000000000006
- end
-
- on enterFrame me
- if not pSprite.flipH then
- pRotation = pRotation + pInc
- xPos = pWow
- yPos = sin(pRotation * PI / 180) * 5.5
- pLocation = pLocation + [xPos, yPos]
- pSprite.loc = point(pLocation[1], pLocation[2])
- if pSprite.locH > ((the stage).rect.width + pSprite.width) then
- pWow = pWow * -1
- pSprite.flipH = not pSprite.flipH
- pSprite.locV = random(440)
- pLocation = [float(pSprite.locH), float(pSprite.locV)]
- end if
- else
- if pSprite.flipH then
- pRotation = pRotation + pInc
- xPos = pWow
- yPos = sin(pRotation * PI / 180) * 5.5
- pLocation = pLocation + [xPos, yPos]
- pSprite.loc = point(pLocation[1], pLocation[2])
- if pSprite.locH < (0 - pSprite.width) then
- pWow = pWow * -1
- pSprite.flipH = not pSprite.flipH
- pSprite.locV = random(440)
- pLocation = [float(pSprite.locH), float(pSprite.locV)]
- end if
- end if
- end if
- end
-